package com.company.strategy.type1;

/**
 * 上下文角色
 */
public class Context {
    //持有抽象策略实例引用
    Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    /**
     * 根据策略执行算法
     */
    public void executeStrategy() {
        strategy.algorithm();
    }
}
